package com.fc.enums;


import lombok.Getter;

@Getter
public enum TransportStatus implements IEnum{
    STARTED(1, "运输中"),
    COMPLETED(2, "已完成");

    private final int code;
    private final String description;

    TransportStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static TransportStatus fromCode(int code) {
        for (TransportStatus status : TransportStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("状态异常: " + code);
    }
}